<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery-1.12.4.min.js"></script>
    <script>
        // 定义json数据必须使用双引号
        var my_str = '{"name": "麦麦", "age": 18}'

        console.log(typeof(my_str), my_str);

        // 打印json对象
        var my_json = JSON.parse(my_str);
        console.log(my_json.name, my_json.age);

        // 直接定义
        var json_obj = {"name":"anna","age":20}
    </script>
</head>
<body>
    
</body>
</html>